<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>异步加载地图</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<style type="text/css">
		body, html, #allmap {
			width: 100%;
			height: 100%;
			overflow: hidden;
			margin: 0;
			font-family: "微软雅黑";
		}
	</style>
</head>
<body>
<div id="allmap"></div>
<script type="text/javascript">
  function init() {
    let map = new BMapGL.Map('allmap');
    let point = new BMapGL.Point(114.92,27.81)
    map.centerAndZoom(point, 12)
    map.enableScrollWheelZoom(true)
  }

  function loadScript() {
			let script = document.createElement('script')
		  script.src = "https://api.map.baidu.com/api?v=1.0&type=webgl&ak=KzmFqkWUs9MbKNwQqLUeCWF8giEWZnox&callback=init";
			document.body.appendChild(script)
  }
  window.onload = loadScript;
</script>

</body>
</html>

